package thread;

public class ThreadDemo2 {
    public static void main(String[] args) {
//        创建线程任务方法
        MyRunnable mr=new MyRunnable();
        Thread th=new Thread(mr);
        th.start();
        for (int i = 0; i <1000 ; i++) {
            System.out.println("main主线程执行了"+i);
        }
    }
}
class MyRunnable implements Runnable{
    @Override
    public void run(){
        for (int i = 0; i < 2000; i++) {
            System.out.println("线程任务执行了"+i);
        }
    }
}
